Skip to content

feat: add support for gke clusterclass #1442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

salasberryfin
Copy link
Contributor

@salasberryfin salasberryfin commented Mar 11, 2025

Still work-in-progress but would appreciate any comments/reviews.

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support for managed clusters (GKE) provisioning using ClusterClass, implementing the template types required to satisfy the CAPI contract.

New templates for GKE cluster provisioning via ClusterClass are added to ./templates:

  • Standard GKE cluster: ./templates/cluster-template-gke-clusterclass.yaml and ./templates/cluster-template-gke-topology.yaml
  • Autopilot cluster: ./templates/cluster-template-gke-autopilot-clusterclass.yaml and ./templates/cluster-template-gke-autopilot-topology

I've tried these two templates with the current CAPI and CAPG and both clusters are provisioned successfully.

Pending: adding e2e tests

Existing GKE E2E tests are not running because of issues with GCP permissions which we're trying to get fixed here. There is a separate PR to enable these tests on CI. Considering GKE is still an experimental feature of CAPG, I'd suggest we try to get this feature added and, in parallel, work on having E2E permissions fixed. Specially considering that this adds lots of lines of new code, having to keep this PR up to date for a long time may become quite complex.

Which issue(s) this PR fixes:
Fixes #1387

Special notes for your reviewer:

Changes affect the experimental GKE feature which hopefully helps with publishing changes in the API.

NOTE: After bumping to CAPI v1.10 this PR required a number of changes. Since some of these have already been applied in existing GKE (non-clusterclass) logic, there was some overlap of code and I've switched some methods to functions so that they can be reused across different resources (i.e. GCPManagedMachinePool and GCPManagedMachinePoolTemplate have equivalent ValidateUpdate logic and it would not make sense to maintain separate code for each resource). Some of the changes also apply to using individual validation of fields in the specification, rather than doing bulk validation of multiple fields at the same time: this means the code is more verbose but I consider it is overall more clear and definitely makes it more reusable and scalable down the line.

Follow-ups:

  • Add documentation to book.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Experimental feature GKE now supports provisioning via ClusterClass

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 11, 2025
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 11, 2025
Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit c430ad0
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/686cd6ab8c23c00008f414fe
😎 Deploy Preview https://deploy-preview-1442--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch 3 times, most recently from 29808fb to 93c4e3d Compare March 13, 2025 10:02
@salasberryfin salasberryfin changed the title WIP: feat: add support for gke clusterclass feat: add support for gke clusterclass Mar 13, 2025
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 13, 2025
@salasberryfin salasberryfin marked this pull request as ready for review March 13, 2025 10:06
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 13, 2025
@k8s-ci-robot k8s-ci-robot requested a review from damdo March 13, 2025 10:06
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch 6 times, most recently from 833f5a4 to 8def4a9 Compare March 13, 2025 14:16
@salasberryfin salasberryfin changed the title feat: add support for gke clusterclass WIP: feat: add support for gke clusterclass Mar 13, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 13, 2025
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch 3 times, most recently from 7856476 to 36977fa Compare March 17, 2025 12:20
@salasberryfin salasberryfin changed the title WIP: feat: add support for gke clusterclass feat: add support for gke clusterclass Mar 18, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2025
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch 2 times, most recently from 7e60a2b to f8cd86f Compare March 18, 2025 10:34
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 16, 2025
@salasberryfin
Copy link
Contributor Author

/remove-lifecycle-stale

@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch from f8cd86f to 46b02af Compare June 24, 2025 09:07
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: salasberryfin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2025
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch from 46b02af to 052dfc1 Compare July 4, 2025 10:00
@salasberryfin salasberryfin changed the title feat: add support for gke clusterclass WIP: feat: add support for gke clusterclass Jul 4, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 4, 2025
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch 4 times, most recently from d944047 to 4071059 Compare July 4, 2025 13:07
@salasberryfin salasberryfin force-pushed the gke-clusterclass-support branch from 4071059 to c430ad0 Compare July 8, 2025 08:28
@salasberryfin salasberryfin changed the title WIP: feat: add support for gke clusterclass feat: add support for gke clusterclass Jul 8, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2025
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 8, 2025

@salasberryfin: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-gcp-apidiff c430ad0 link false /test pull-cluster-api-provider-gcp-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@salasberryfin
Copy link
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional role to service account used by CAPG e2e tests GKE ClusterClass support
4 participants